//
//  HKPickerDetailDelegate.m
//  HKAddressBookManager
//
//  Created by 胡锦涛 on 2018/12/27.
//  Copyright © 2018 胡锦涛. All rights reserved.
//

#import "HKPickerDetailDelegate.h"

@implementation HKPickerDetailDelegate

#pragma mark - CNContactPickerDelegate

- (void)contactPicker:(CNContactPickerViewController *)picker didSelectContactProperty:(CNContactProperty *)contactProperty
{
    CNContact *contact = contactProperty.contact;
    //NSData * data = contactProperty.contact.imageData;
    NSString *name = [CNContactFormatter stringFromContact:contact style:CNContactFormatterStyleFullName];
    
    CNPhoneNumber *phoneValue= contactProperty.value;
    NSString *phoneNumber = phoneValue.stringValue;
    
    if (self.handler)
    {
        self.handler(name, phoneNumber);
    }
}

@end
